/**
 * 旅行管理
 */
import request from '@/http'

// 列表分页查询
export const page = async (data: object) => {
  return await request.post({
    url: '/bizz/finTEvection/evectionPage',
    data: data
  })
}

// 新增
export const add = async (data: object) => {
  return await request.post({
    url: '/bizz/finTEvection',
    data: data,
  })
}

// 更新
export const update = async (data: object) => {
  return await request.post({
    url: '/bizz/finTEvection/update',
    data: data
  })
}

// 删除
export const del = async (data: Array<any>) => {
  return await request.post({
    url: '/bizz/finTEvection/delete',
    data,
    headersType: 'application/x-www-form-urlencoded'
  })
}

// 报表当月出差统计查询
export const travelNumByMon = async (data: object) => {
  return await request.post({
    url: '/bizz/finTEvection/travelNumByMon',
    data,
    headersType: 'application/x-www-form-urlencoded'
  })
}

// 单体查询
export const query = async (id: String) => {
  return await request.get({
    url: '/bizz/finTEvection/' + id,
  })
}

// 导出
export const download = async (data: object) => {
  return await request.download1({
    url: '/bizz/finTEvection/export',
    data
  })
}

// 出差人员
export const evectionUserTree = async (id: String) => {
  return await request.get({
    url: '/bizz/finTEvection/tree/'+ id
  })
}

// 部门
export const validTree = async (id: String) => {
  return await request.get({
    url: '/bizz/finTArea/validTree/'+ id
  })
}

// 部门用户信息
export const userTree = async (id: String[]) => {
  return await request.post({
    url: '/authority/sysTUser/getUserList/'+ id
  })
}

// 获取有效树形数据  unitid
export const validTreeApply = async (id: String) => {
  return await request.get({
    url: '/bizz/finTEvection/tree/' + id,
  })
}



